package top.littlejiang.onlinexam.common.base;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author chen
 * @Description
 * @since 2021/2/26 21:12
 */
@Data
public class BaseTree<T> {

    /**
     * 主键id
     */
    private Serializable id;

    /**
     * 父级id
     */
    private Serializable parentId;

    /**
     * 子节点列表
     */
    private List<BaseTree<T>> children;

    public BaseTree(Serializable id, Serializable parentId){
        this.id = id;
        this.parentId = parentId;
        this.children = new ArrayList<BaseTree<T>>();
    }
}
